package com.protobuftest.protobuf;

import java.io.RandomAccessFile;

public class TTT {

	static RandomAccessFile fw;
	public static void main(String[] args) throws Exception {
		fw = new RandomAccessFile("a.txt", "rw");
		new Thread(()->{
			int i = 1;
			while(true) {
				try {
//					fw.write("abcadsfadsfads".getBytes());
					fw.seek(100);
					fw.write((i+"ccc").getBytes(), 0, 2);
//					fw.write("abc".getBytes(), 100, 2);
					Thread.sleep(1000);
					i++;
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		}).start();
	}
}
